package com.ls.fw.web.file.bean;



/**
 * 文件下载类型
 * @author Defender
 * 2014年6月8日上午12:57:13
 */
public enum DownStyle {

	 ABSOLUTE(1)
	,BYTEARRAY(2)
	,BYTESTREAM(3)
	,STREAM(0);
	
	private int type = 0;
	
	private DownStyle(int type){
		this.type = type;
	}

	public int getType() {
		return type;
	}
	
	public static DownStyle value(int type) {
		// 所有的枚举值
		DownStyle[] season = values();
		// 遍历查找
		for (DownStyle s : season) {
			if (s.getType()==type) {
				return s;
			}
		}
		return null;
	}
	
	public static boolean contains(int type) {
		// 所有的枚举值
		DownStyle[] season = values();
		// 遍历查找
		for (DownStyle s : season) {
			if (s.getType()==type) {
				return true;
			}
		}
		return false;
	}
}
